{temp('kefu/head')}
</head>
<body>
	<div class="pd-20">
		<div class="form form-horizontal" id="form-article-add">
			<div class="row cl">
				<label class="form-label col-2">姓名:</label>
				<div class="formControls col-4">
					<input type="text" class="input-text" value="{if(@$user['base']['name'])}{$user['base']['name']}{/if}" id="name" name="name">
				</div>
			</div>
			<div class="row cl">
				<label class="form-label col-2">身份证号:</label>
				<div class="formControls col-4">
					<input type="text" class="input-text" value="{if(@$user['base']['sfzh'])}{$user['base']['sfzh']}{/if}" id="sfz" name="sfz">
				</div>
			</div>
			<div class="row cl">
				<label class="form-label col-2">邮箱:</label>
				<div class="formControls col-4">
					<input type="text" class="input-text" value="{if(@$user['email'])}{$user['email']}{/if}" id="email" name="email">
				</div>
			</div>
			<div class="row cl">
				<label class="form-label col-2">手机:</label>
				<div class="formControls col-2"> 
					<input type="text" class="input-text" value="{if(@$user['phone'])}{$user['phone']}{/if}" id="phone" name="phone"> 
				</div>
			</div>
			<div class="row cl">
				<label class="form-label col-2">积分:</label>
				<div class="formControls col-2"> 
					<input type="text" class="input-text" value="{if(@$user['jifen'])}{$user['jifen']}{/if}" id="jf" name="jf"> 
				</div>
			</div>
			<div class="row cl">
				<div class="col-10 col-offset-2">
					<button onClick="tj({$user['id']});" class="btn btn-primary radius" type="submit">&nbsp;&nbsp;提交&nbsp;&nbsp;</button>
					<button onClick="layer_close();" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
				</div>
			</div>
		</div>
	</div>
	<script type="text/javascript">
	function tj(id){
		var name = document.getElementById('name').value;
		var sfz = document.getElementById('sfz').value;
		var email = document.getElementById('email').value;
		var phone = document.getElementById('phone').value;
		var jf = document.getElementById('jf').value;
		$.post('{$_url}/kefu/?act=user&met=zj_u',{id:id,name:name,sfz:sfz,email:email,phone:phone,jf:jf},function(data){
			if(data == 'cg'){
				layer.alert('修改成功');
				setTimeout(function(){parent.location.reload();},800);return ;
			}else if(data == 'error'){
				layer.alert('修改失败');return ;
			}else if(data == '-1'){
				layer.alert('部分数据修改成功');return ;
			}else if(data == '-2'){
				layer.alert('此手机号已存在');return ;
			}else if(data == '-3'){
				layer.alert('此邮箱已存在');return ;
			}
		});
	}
	</script>
	{temp('kefu/foot')}
</body>
</html>